// vue前端接口模板
import request from '@/utils/request' // utils/request.js

import {
  Loading,
  Message
} from 'element-ui'



/**
 * 实体传参
 */
 export async function reqLoading(method,url, data) {
  //加载loading
  const loadingInstance = Loading.service({
    fullscreen: true,
    text: 'Loading',
    spinner: 'el-icon-loading',
    background: 'rgba(0, 0, 0, 0.7)'
  });
  const res = await request({
    baseURL: process.env.VUE_APP_BASE_API ,
    url: url,
    method: method,
    data
  })
  //关闭loading
  loadingInstance.close();
  return res
}

export async function req(method, url, data) {
  const res = await request({
    baseURL: process.env.VUE_APP_BASE_API ,
    url: url,
    method: method,
    data
  })
  return res
}


